<template>
	<view class="cu-modal" :class="show ?'show':''">
		<view class="cu-dialog">
			<view class="cu-bar bg-white justify-end">
				<view class="content">{{title || '提示'}}</view>
				<view class="action" @click="$emit('cancel')">
					<text class="cuIcon-close text-red"></text>
				</view>
			</view>
			<view v-if="content" class="padding-xl">
				{{content}}
			</view>
			<slot v-else />
			<view class="cu-bar bg-white justify-end">
				<view class="action">
					<button v-if="showCancel" class="cu-btn line-green text-green" @click="$emit('cancel')">取消</button>
					<button class="cu-btn bg-green margin-left" @tap="$emit('confirm')">确定</button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		props:{
			show:Boolean,
			title:String,
			content:String,
			showCancel:{type:Boolean,default:true},
			cancelText:{type:String,default:'取消'}
		}
	}
</script>

<style>
</style>